//
//  GMSm2r1Tests.m
//  GMObjC_Tests
//
//  Created by lif on 2020/7/10.
//  Copyright © 2020 lifei. All rights reserved.
//

#import "GMSm2v1Tests.h"

@interface GMSm2r1Tests : GMSm2v1Tests

@end

@implementation GMSm2r1Tests

- (void)setUp {
    [super setUp];
    [GMSm2Utils setCurveType:GMSm2CurveSecp256r1];
    
    self.gPubKey = @"04A33A74AF3F6C3308DEC527CDB75B782DB5C2257392F10E9093FC03AD7E1EC8FF01D4B3A7CF4E9697E746E8F8F84D4295B25BE979CCB8D3EE7E71EBADAB2A9B07";
    self.gPriKey = @"596C933846B1F31C18E9020E471E3D8F5ED123DCDF63A661829FC32739F039BD";
    
    // 正确的加密后的数据
    self.gCipherText = @"306F0220374011DA7991DE3E3BC3C344679A97EE98593AF33DCA5A83A079FD22D81B4939022100BCAB12474FA5D603D6999210804E9AFE456E9C3197550438351DE53AE263E8C90420028C9A9AE2F4193FC02C21490DAB4D7CB797019749147099333D56925A36D5D3040620A93395578D";
    self.gCipherHex = @"30700221009E6AA02E22D52079A78F91E5CAD77C2A7B303090DE3134342F38B89B68FE5595022100B62D98F212DFEE56CEF8C44CB8A4D0DEA0922CB19A506C0E959180799DEB5DC804209F03F6038F3AA6F4F52E74D9138A1195CBA788E2F9E5ABC6E93449B15C33E76404069408C01E04D2";
    self.gCipherDataHex = @"306F02207876CA65E9D3C1FB26FEB7A686C5F35F3389B48BA6B2070462BE75786FB95BD8022100E3D162FBA711C02CAABB20AF3F6CC54F76A38C267AB514EEE3D4D08AB25C6AB20420189BAFB3B70AAD3BB4B82D8E4748D02CA013FC230BEB2295DA05E1BDDEC3EAE1040635C838F52E73";
}

- (void)tearDown {
    self.gPubKey = nil;
    self.gPriKey = nil;
    self.gCipherHex = nil;
    self.gCipherHex = nil;
    self.gCipherDataHex = nil;
    [super tearDown];
}

// MARK: - 椭圆曲线类型
- (void)testEllipticCurveType {
    int currentType = [GMSm2Utils curveType];
    XCTAssertTrue(currentType == GMSm2CurveSecp256r1, @"当前椭圆曲线应为 NID_X9_62_prime256v1");
}

@end
